Skip to main content
POST
/
v1
/
axons
/
{id}
/
sql
/
batch
JavaScript
import Runloop from '@runloop/api-client';

const client = new Runloop({
  bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});

const sqlBatchResultView = await client.axons.sql.batch('id', { statements: [{ sql: 'sql' }] });

console.log(sqlBatchResultView.results);
{
  "results": [
    {
      "success": {
        "columns": [
          {
            "name": "<string>",
            "type": "<string>"
          }
        ],
        "rows": [
          {}
        ],
        "meta": {
          "duration_ms": 123,
          "changes": 123,
          "rows_read_limit_reached": true
        }
      },
      "error": {
        "message": "<string>"
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

The axon identifier.

Body

application/json
statements
object[]
required

The SQL statements to execute atomically within a transaction.

Response

200 - application/json

OK

results
object[]
required

One result per statement, in order.